<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width= , initial-scale=1.0">
    <title>数组转化为字符串</title>
    <script>
        var arr1 = [1,2,'pig','小李同学','小汪'];
        var str = '';
        var sep = '*'
        for (var i = 0; i < arr1.length; i++) {
            str += arr1[i] + sep;
        }
        console.log(str);
    </script>
</head>
<body>
    
</body>
</html>